package com.logistics.pick.controller;


import com.logistics.pick.entity.model.PickContainerSave;
import com.logistics.pick.service.PickContainerService;
import com.logistics.utils.aspect.annotation.LoggerListener;
import com.logistics.utils.constants.LoggerMethod;
import com.logistics.utils.exception.MessageException;
import com.logistics.utils.response.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 拣配托盘 前端控制器
 * </p>
 *
 * @author yunjian.ban
 * @since 2024-06-27
 */
@RestController
@RequestMapping("lgs/pickContainer")
public class PickContainerController {

    @Autowired
    private PickContainerService pickContainerService;

    /**
     * 更新拣配托盘
     * @param params
     * @return
     */
    @PutMapping("/removeContainerRelation")
    @LoggerListener(businessName = "更新拣配托盘", methodName = LoggerMethod.SAVE)
    public ResponseEntity removeContainerRelation(@RequestBody PickContainerSave params) throws MessageException {
        pickContainerService.removeContainerRelation(params);
        return ResponseUtil.success();
    }

    /**
     * 更新站点
     * @param params
     * @return
     */
    @PutMapping("/updateStation")
    @LoggerListener(businessName = "更新站点", methodName = LoggerMethod.SAVE)
    public ResponseEntity updateStation(@RequestBody PickContainerSave params) throws MessageException {
        pickContainerService.updateStation(params);
        return ResponseUtil.success();
    }

}

